
import matplotlib.pyplot as plt

# CNN
yn1 =[0.1730257320319432,0.19448275862068964,0.2627358490566038,0.35135135135135137,0.46352723915050786,0.613838242169238,0.8140174072377462,0.9123134328358209,0.9217625899280576,0.9096573208722741,0.905761500669942,0.9164785553047404,0.9138840070298769,0.9187145557655955,0.9177132957990473,0.9172932330827067,0.9175022789425706,0.9042163153070577,0.9138559708295351,0.47719030349303304
]
yn2=[0.10360565951620265,0.1283542039355993,0.1861652739090065,0.2716335030078667,0.39313861845155307,0.599437148217636,0.7851753217931646,0.8994240141781126,0.9043951064793838,0.9105764866091693,0.9143633892161305,0.9107635694572217,0.9122649955237243,0.9070191431175935,0.9153534443944169,0.9209302325581395,0.9120370370370371,0.9110599078341014,0.897716894977169,0.11442465851390976
]
yn3=[0.2281095644364616,0.2588075880758808,0.32125279642058163,0.4037647058823529,0.5336384439359267,0.6864481842338352,0.8594104308390023,0.9271616541353384,0.9191780821917809,0.915625,0.9150858175248419,0.9203791469194312,0.920018281535649,0.924468566259611,0.9291266575217193,0.9253034547152195,0.9278026905829596,0.9164754474529601,0.932963476652797,1.11913555243155663
]

# DNN
yd1=[0.16118573413617415,0.1873568483737975,0.26063348416289595,0.3306878306878307,0.4848877374784111,0.6800182066454256,0.8289592760180996,0.9141048824593129,0.9249304911955515,0.9094942324755989,0.9102623101702715,0.9204072188801481,0.916819012797075,0.9107551487414187,0.9149779735682819,0.9151205936920223,0.9133055169216504,0.9206134415877312,0.9165170556552962,1.3238044990167392
]
yd2=[0.2168284789644013,0.2356164383561644,0.30647291941875826,0.3962877030162413,0.5555555555555556,0.7147293700088732,0.8628747795414462,0.9199640287769785,0.917162471395881,0.921256258534365,0.9202200825309491,0.9272811486799444,0.9126705829191143,0.9167773351040284,0.9267415730337079,0.9206708975521306,0.9084604715672677,0.9162539396668168,0.9142599277978339,1.9589955346425314
]

# TCN
yt1=[0.3125581395348837,0.333945796968305,0.40315315315315314,0.4787234042553192,0.6203833567087425,0.768242312987609,0.8757961783439491,0.9235100891600188,0.9330922242314648,0.9266697804764129,0.9239280774550485,0.93600721045516,0.9272486772486772,0.9362370902559497,0.9245960502692998,0.9338168631006346,0.9336322869955157,0.9425339366515837,0.931322505800464,1.4030824936277662
]
yt2=[0.4186471663619744,0.450530035335689,0.5069413345275414,0.5658300308234258,0.672306322350846,0.7947658402203857,0.8965986394557823,0.9301290609701824,0.9390595009596929,0.9345018450184502,0.9366034243405831,0.9386642435256701,0.941253836036826,0.9479311947931195,0.9409576940957695,0.9477510222626079,0.9373539036933146,0.9409851301115242,0.945413870246085,2.2713889685498518
]
yt3=[0.2838529548627268,0.30683836589698044,0.3740354062641852,0.43478260869565216,0.5743119266055046,0.7485510477039679,0.8564400715563506,0.9127486437613019,0.9280182232346241,0.9344716197508076,0.9208059981255857,0.9324699352451434,0.932475884244373,0.9247706422018349,0.9378739070409572,0.9298892988929889,0.9290649470290189,0.9289760348583878,0.9116047144152312,1.2812559648787936
]
yt4=[0.3983088562527815,0.41785714285714287,0.4889807162534435,0.5567918405192397,0.677059097254537,0.7957943925233645,0.8941176470588236,0.9454061251664447,0.9427393495190105,0.9454709328526363,0.9425444596443229,0.9413936317489617,0.9408284023668639,0.9394618834080718,0.9396124380351509,0.9406971480307832,0.9387477313974592,0.939666816749212,0.9334245326037391,2.5390395061137565
]

# LSTM
yl1=[0.19774774774774775,0.22985347985347984,0.2683806946323861,0.3745928338762215,0.5027051397655545,0.6839028776978417,0.8288246268656716,0.9213737008585631,0.9115456238361266,0.923438233912635,0.9217512808570097,0.9222020018198362,0.9278074866310161,0.9170105456212746,0.930285196921684,0.9179954441913439,0.9136089177891314,0.9144882587505538,0.9244541484716157,1.0198662846227316
]
yl2=[0.2328316086547507,0.25196123673281035,0.3130311614730878,0.3958521190261497,0.5285451197053407,0.6779891304347826,0.8480956598759964,0.9137010676156584,0.923963133640553,0.9118982742960945,0.9268730372364289,0.9213381555153707,0.9236474694589878,0.9211563731931669,0.9256386861313869,0.9233286582515194,0.9208277103013945,0.924056389267849,0.9230072463768116,1.3117500479202607
]
yl3=[0.2204968944099379,0.23900841908325537,0.29516423357664234,0.3625282167042889,0.5209195402298851,0.6824732682473268,0.833257403189066,0.9167048054919908,0.9300925925925926,0.9212093449381585,0.9246298788694481,0.9177509293680297,0.9231473010064044,0.9233853006681515,0.9209450249886415,0.923368022705771,0.9144859813084112,0.909433962264151,0.9201468563561267,1.4673114303323378
]

# CBAMTCN
yct1=[0.4203160270880361,0.4360125729681186,0.46436781609195404,0.5628440366972477,0.6500453309156845,0.7757685352622061,0.8728538283062645,0.9257901969766377,0.9426868408986704,0.9463548830811555,0.9423334823424229,0.9396471680594243,0.9299363057324841,0.9425815342214056,0.9434298440979956,0.9445430346051464,0.9410460992907801,0.9367996414164051,0.9432432432432433,1.3640831395488218
]
yct2=[0.3358812949640288,0.3542039355992844,0.43012211668928085,0.4862426702751466,0.6136464333185645,0.7447392497712717,0.867183934276586,0.9321955719557196,0.9411764705882353,0.9299065420560748,0.9392191659272404,0.9328558639212176,0.9317073170731708,0.927536231884058,0.9358860195903829,0.9391860996799268,0.9283446712018141,0.9336099585062241,0.9391860996799268,0.25423994628426178
]
yct3=[0.3299015219337511,0.31899313501144166,0.3863114377583831,0.45491990846681923,0.5932126696832579,0.733099209833187,0.853290676416819,0.9306122448979591,0.93184855233853,0.9308776716689404,0.9293253786140432,0.9295392953929539,0.9367028814359943,0.9295332136445242,0.9324817518248175,0.9315789473684211,0.9308755760368663,0.9390746678882272,0.9276164130935916,0.222690484172214
]

#CBAMLSTM
ybl1=[0.1506294964028777,0.17638952687184198,0.2536101083032491,0.3386034255599473,0.46079335793357934,0.6826789838337183,0.8606520768200089,0.9207875457875457,0.9125174499767333,0.9215686274509803,0.9204072188801481,0.9184035476718404,0.9230068337129841,0.9217902350813744,0.9145146927871772,0.9144021739130435,0.917706888580675,0.9156462585034013,0.9142461964038727,0.05024644685840073
]
ybl2=[0.185894441849603,0.19157427937915744,0.2666360715924736,0.3405152224824356,0.47105141269106066,0.6442220200181984,0.8513266239707228,0.913324112494237,0.9233183856502242,0.9143251957623215,0.9180700955848885,0.9106894956038871,0.9206798866855525,0.9227373068432672,0.9121076233183857,0.9188340807174888,0.9127906976744186,0.9241071428571429,0.9210872424375274,0.1052153327434898]

ybl4=[0.3121815655396017,0.3236231224396905,0.38743218806509944,0.44530186109850206,0.5885057471264368,0.7348519362186788,0.8908765652951699,0.9347530584503851,0.935088515660463,0.9246669728984842,0.9411227749885896,0.9321802457897133,0.9299506061966771,0.932780847145488,0.9357838795394154,0.9262295081967213,0.9220246238030095,0.9209558823529411,0.93978590544157,0.16752824047048229
]
ybl5=[0.22783143107989465,0.26119402985074625,0.3330262551819438,0.3915294117647059,0.5340599455040872,0.698455949137148,0.8713185319438151,0.9188823794502028,0.9274588340008901,0.9089661482159195,0.9244523915958873,0.9321884632320564,0.9079479119892232,0.926944971537002,0.9149135109864422,0.916892502258356,0.9192100538599641,0.9217954650624711,0.9160935350756534,0.1187600373930344
]



y1 = [0.4506201194304088,0.49228735125605994,0.5649977032613689,0.6376944190301921,0.7375627567320858,0.8762157382847038,0.9433713784021072,0.9474885844748858,0.9433962264150944,0.9462563160312356,0.9399558498896248,0.9464852607709751,0.9474629546475078,0.9560887279311906,0.9512534818941504,0.9483960948396095,0.9392694063926941,0.9456617002629273,0.9514692787177204]
y2 = [0.09517601043024772,0.13333333333333333,0.2032447048219919,0.27366997294860235,0.4360730593607306,0.6592526690391459,0.8607476635514019,0.9095840867992767,0.9064748201438849,0.9083969465648855,0.915068493150685,0.9033273381294964,0.9103448275862069,0.9059945504087193,0.9036591014358499,0.9035369774919614,0.911567664135775,0.9102390617952187,0.9200945626477541]
y3 = [0.3040881947634359,0.33077617328519854,0.3641750227894257,0.4707719767960732,0.5733924611973392,0.7359550561797753,0.8482789855072463,0.9099821746880571,0.9224137931034483,0.9316279069767441,0.92686230248307,0.9286372007366482,0.927886809675947,0.9330296127562643,0.9330954504906334,0.9266304347826086,0.9214986619090099,0.9292792792792792,0.9399906235349273]
y4 = [0.1179981634527089,0.1484339536995007,0.23470319634703196,0.3087621696801113,0.4628469113697404,0.6736990154711674,0.8639855399909625,0.9154545454545454,0.9127337488869101,0.9120111731843575,0.912180052956752,0.9147180192572214,0.9061224489795918,0.9171270718232044,0.9125858123569794,0.9161319890009166,0.915238954012624,0.9212454212454212,0.9262826984855439]

x = [ -18, -16, -14, -12, -10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
plt.plot(x, y1, linewidth=1, color="blue", marker="o")
plt.plot(x, y2, linewidth=1, color="red", marker="o")
plt.plot(x, y3, linewidth=1, color="orange", marker="o")
plt.plot(x, y4, linewidth=1, color="yellow", marker="o")


plt.xlabel("SNR(dB)")
plt.ylabel("Pd")
plt.legend(["pf=3.20%", "pf=0.80%","pf=1.49%","pf=1.06%"], loc="upper left")#设置线条标识
plt.xlim([-20, 20])
plt.ylim([0.0, 1])
plt.show()